<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<button onclick="hello()">异步发送User对象数据</button>
<script src="https://unpkg.com/axios/dist/axios.js"></script>
<script src="https://cdn.bootcss.com/qs/6.5.1/qs.min.js"></script>
<script>
    let user={
        userId:10011,
        userName:"admin",
        password: "admin"
    };

    function hello() {
        axios.post('http://localhost:8080/springmvcdemo001/user/hello5',Qs.stringify(user))
            .then(response=>{
                console.log(response.data);
        }).catch(error=>{
            console.log(error);
        })
    }
</script>
</body>
</html>